 <%@page import="java.sql.ResultSet" import="java.sql.Statement" import="java.sql.Connection" import="connection.DBConnection"%>
<%@ page import="java.util.*" language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@page import="java.text.SimpleDateFormat" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%
      int totalElements = 5;
      ArrayList r = new ArrayList (totalElements);
      for (int i=1;i <= totalElements;i++)
      {
         r.add (String.valueOf (i));
      }
%>
        <script type="text/javascript">
            function addSelectBox ()
            {
                var parentDiv = document.getElementById ("main");
                var selectElement = document.createElement ("select");
                var option;
<%
                for (int i=0;i <= r.size();i++)
                {
%>
                    option = new Option (  '"<%=r.get(i)%>"' , '"<%=r.get(i)%>"' );
                    selectElement.options[selectElement.options.length] = option;
<%
                }
%>
                parentDiv.appendChild (selectElement);
            }
        </script>
      </head>
      <body>
        <div id="main">
            <input type="button" onclick="addSelectBox ()" name="clickme" value="Add Select Box" />
        </div>
      </body>
    </html>